package com.yzd.netmonitor.web;

public class RespBodyBuilder {

	public RespBody toSuccess() {

		return new RespBody();
	}

	public RespBody toSuccess(Object result) {

		return new RespBody(ResponseCode.CODE_200, result);
	}

	public RespBody toSuccess(ResponseCode code, Object result) {

		RespBody reps = new RespBody(code, result);
		return reps;
	}

	public RespBody toError(ResponseCode code) {

		RespBody reps = new RespBody(code);
		return reps;
	}

	public RespBody toError(ResponseCode code, String message) {

		RespBody reps = new RespBody(code, message, null);
		return reps;
	}

	public RespBody toError(ResponseCode code, Throwable e) {

		RespBody reps = new RespBody(code, e);
		return reps;
	}
}
